package com.comtop.topcloud.device.model.influxdb;


import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;

import java.time.LocalDateTime;

@Data
@Measurement(name = "iot_device_reporting_data_pro")
public class DeviceReportingDataModel {

    @Column(name = "val")
    private Double val; // 当前值（如温度、电压、湿度等）

    @Column(name = "data_quality")
    private Integer dataQuality; // 数据质量码（0=不确定，64=差，192=好）

    @Column(name = "version")
    private String version; // 数据格式版本

    @Column(name = "time_offset")
    private Integer timeOffset; // 可选字段，相对时间偏移（可为负值）

    @Column(name = "location")
    private String location; // 设备位置（例如：117.129005,36.675426）

    @Column(name = "device_name")
    private String deviceName; // 设备名称，标识具体设备

    @Column(name = "monitor_name")
    private String monitorName;

    @Column(name = "monitor_id", tag = true)
    private String monitorId;

    @Column(name = "product_key", tag = true)
    private String productKey; // 产品系列编号

    @Column(name = "serial_number")
    private String serialNumber; // 网关编号（序列号）

    @Column(name = "tag_name", tag = true)
    private String tagName; // 标签名称（例如：TagName_1）

    @Column(name = "timestamp", tag = true)
    private Long timestamp; // 绝对时间（Unix 时间戳，单位：秒）

    @Column(name = "org_id", tag = true)
    private String orgId; // 组织编码

    @Column(name = "project_id", tag = true)
    private String projectId; // 项目ID

    @Column(name = "device_id", tag = true)
    private String deviceId; // 设备ID（设备的唯一标识符）

    @Column(name = "time")
    private LocalDateTime time;

}